package cn.iocoder.yudao.module.expert.dal.mysql.extractinfo;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.expert.dal.dataobject.extractinfo.ExtractInfoDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.expert.controller.admin.extractinfo.vo.*;

/**
 * 抽签结果 Mapper
 *
 * @author 周天贺
 */
@Mapper
public interface ExtractInfoMapper extends BaseMapperX<ExtractInfoDO> {

    default PageResult<ExtractInfoDO> selectPage(ExtractInfoPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ExtractInfoDO>()
                .eqIfPresent(ExtractInfoDO::getId, reqVO.getId())
                .eqIfPresent(ExtractInfoDO::getExtractBatchNum, reqVO.getExtractBatchNum())
                .eqIfPresent(ExtractInfoDO::getExtractExpertNum, reqVO.getExtractExpertNum())
                .betweenIfPresent(ExtractInfoDO::getExtractTime, reqVO.getExtractTime())
                .eqIfPresent(ExtractInfoDO::getExpertId, reqVO.getExpertId())
                .eqIfPresent(ExtractInfoDO::getProjectId, reqVO.getProjectId())
                .likeIfPresent(ExtractInfoDO::getExpertName, reqVO.getExpertName())
                .eqIfPresent(ExtractInfoDO::getExpertUnit, reqVO.getExpertUnit())
                .eqIfPresent(ExtractInfoDO::getExpertPhone, reqVO.getExpertPhone())
                .eqIfPresent(ExtractInfoDO::getExpertMajor, reqVO.getExpertMajor())
                .eqIfPresent(ExtractInfoDO::getExpertTitle, reqVO.getExpertTitle())
                .eqIfPresent(ExtractInfoDO::getExpertIden, reqVO.getExpertIden())
                .likeIfPresent(ExtractInfoDO::getProjectName, reqVO.getProjectName())
                .eqIfPresent(ExtractInfoDO::getProjectUnit, reqVO.getProjectUnit())
                .eqIfPresent(ExtractInfoDO::getProjectContacts, reqVO.getProjectContacts())
                .eqIfPresent(ExtractInfoDO::getProjectPhone, reqVO.getProjectPhone())
                .eqIfPresent(ExtractInfoDO::getProjectMajor, reqVO.getProjectMajor())
                .betweenIfPresent(ExtractInfoDO::getProjectTime, reqVO.getProjectTime())
                .eqIfPresent(ExtractInfoDO::getProjectAddress, reqVO.getProjectAddress())
                .eqIfPresent(ExtractInfoDO::getProjectAmount, reqVO.getProjectAmount())
                .betweenIfPresent(ExtractInfoDO::getProjectTendersTime, reqVO.getProjectTendersTime())
                .eqIfPresent(ExtractInfoDO::getRemark, reqVO.getRemark())
                .betweenIfPresent(ExtractInfoDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(ExtractInfoDO::getProjectName)
                .orderByAsc(ExtractInfoDO::getExtractBatchNum));
    }

}